﻿<div class="blade-static __bottom" ng-include="'$(Platform)/Scripts/common/templates/create.tpl.html'" ng-if="blade.isNew"></div>
<div class="blade-content">
    <div class="blade-inner">
        <div class="inner-block">
            <form name="formScope" class="form">
                <div ng-init="setForm(formScope)">
                    <label class="form-label" for="">Property name</label>
                    <div class="form-input">
                        <input focus-on="" required class="form-control" ng-model="blade.currentEntity.name" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="form-control __checkbox">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isRequired">
                            <span class="check"></span>
                            <span class="name">Required</span>
                        </label>
                    </div>
                    <div class="form-control __checkbox">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isArray" ui-validate=" 'arrayFlagValidator($value)' " ui-validate-watch=" 'blade.currentEntity.valueType' " name="arrayFlag">
                            <span class="check"></span>
                            <span class="name">Multivalue</span>
                        </label>
                    </div>
                    <div class="error" ng-if="formScope.arrayFlag.$invalid">Multivalue property can have only ShortText, Integer or Decimal value type.</div>
                    <div class="form-control __checkbox" ng-class="{'__disabled': !blade.isNew}">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isMultilingual" ui-validate=" 'multilingualFlagValidator($value)' " ui-validate-watch=" 'blade.currentEntity.valueType' " name="multilingualFlag">
                            <span class="check"></span>
                            <span class="name">Multilingual</span>
                        </label>
                    </div>
                    <div class="error" ng-if="formScope.multilingualFlag.$invalid">Only text or HTML value can be multilingual.</div>
                    <div class="form-control __checkbox" ng-class="{'__disabled': !blade.isNew}">
                        <label class="form-label">
                            <input type="checkbox" ng-model="blade.currentEntity.isDictionary" ui-validate=" '!$value || blade.currentEntity.valueType === \'ShortText\'' " ui-validate-watch=" 'blade.currentEntity.valueType' " name="dictFlag">
                            <span class="check"></span>
                            <span class="name">Dictionary</span>
                        </label>
                    </div>
                    <div class="error" ng-if="formScope.dictFlag.$invalid">Only dictionaries of value type ShortText are supported.</div>
                </div>
                <div class="form-group">
                    <label class="form-label" for="">Display name</label>
                    <div class="form-input __langs" ng-repeat="data in blade.currentEntity.displayNames">
                        <span class="flag flag-{{data.locale.substr(3).toLowerCase()}}"></span>
                        <input ng-model="data.name" placeholder="Enter display name..." class="form-control" />
                    </div>
                </div>
            </form>

            <ul class="list __items">
                <li class="list-item" ng-class="{'__selected': currentChild === 'valType', '__disabled': !blade.isNew}" ng-click='openChild("valType")'>
                    <span class="list-t">Value Type</span>
                    <span class="list-descr">{{blade.currentEntity.valueType | dynamicPropertyValueTypeToText}}</span>
                </li>
                <li class="list-item" ng-class="{'__selected': currentChild === 'dict', '__disabled': !blade.currentEntity.isDictionary}" ng-click='openChild("dict")'>
                    <span class="list-t">Dictionary values</span>
                    <span class="list-descr" ng-if="blade.currentEntity.isDictionary">Manage dictionary</span>
                </li>
            </ul>
        </div>
    </div>
</div>